/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// Don't remember if I've tested this one, expect bugs
package sll;
/**
*
* @author mweya
*/
import sll.Node;
import sll.LinkedList;
public class SLL {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Make a new node
Node n1 = new Node<>("", null);
// Print it out
System.out.println(n1);
// Same thing as above
// <> <- This is for autoboxing (literal black magic)
Node<Integer> n2 = new Node<>(12, null);
n1.setNext(n2);
System.out.println(n2);
// How things should probably be done
LinkedList<String> list = new LinkedList<>("Generic and temporary data");
list.addFirst("I'm added first");
list.addLast("I'm added last");
}
}